<template>
  <el-main>
    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="Id"
        width="180">
      </el-table-column>

      <el-table-column
        prop="houseId"
        label="房源ID"
        width="180">
      </el-table-column>
      <el-table-column
        prop="roomName"
        label="房源名称"
        width="180">
      </el-table-column>
      <el-table-column
        prop="roomCode"
        label="房源编号"
        width="180">
      </el-table-column>
      <el-table-column
        prop="proportion"
        label="面积"
        width="180">
      </el-table-column>
      <el-table-column
        prop="rental"
        label="租金"
        width="180">
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="listFangYuan"
    />
  </el-main>
</template>

<script>
  import {listFangYuan} from "@/api/fangyuan/fangyuan";

  export default {
    data(){
      return{
        current:1,
        tableData:[],
        queryParams:{
          pageNum: 1,
          pageSize: 10,
        },
      }
    },created() {
      this.listFangYuan()
    },methods:{
      listFangYuan() {
        listFangYuan(this.queryParams).then(response => {
          console.log(response)
            this.tableData = response.rows;
          this.total = response.total;
          }
        );
      },
    }

  }
</script>

<style scoped>

</style>
